//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.comprosoft.telnet.command;

import com.comprosoft.telnet.io.IOHandler;
import com.comprosoft.telnet.io.TextColor;
import com.comprosoft.telnet.server.TelnetServer;
import java.util.ArrayList;
import java.util.Iterator;

public final class ListCommandHandler extends Command {
    public ListCommandHandler(IOHandler io, TelnetServer telnetServer) {
        super(io, "list", telnetServer);
    }

    protected CommandResult handleCommand(String[] args) {
        ArrayList<AllCommands> list = AllCommands.getAllCommands();
        IOHandler io = super.getIOHandler();
        io.SetTextColor(TextColor.WHITE);
        Iterator var4 = list.iterator();

        while(var4.hasNext()) {
            AllCommands ac = (AllCommands)var4.next();
            String str = String.format("    %-10s - %s", ac.getName(), ac.getDescription());
            io.WriteLine(str);
        }

        return CommandResult.COMMAND_OK;
    }
}
